package com.mazaiting.springdemo.ch01;

import com.mazaiting.spring.annotations.Autowired;
import com.mazaiting.spring.context.AnnotationApplicationContext;
import com.mazaiting.spring.context.ApplicationContext;

/***
 * spring测试 demo
 * @author mazaiting
 * @datetime 2021/11/17 19:28  
 */
public class Test {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationApplicationContext(AppConfig.class);
        TestService service = (TestService) context.getBean("testService");
        TestService service1 = (TestService) context.getBean("testService");
        TestService service2 = (TestService) context.getBean("testService");
        System.out.println(service);
        System.out.println(service1);
        System.out.println(service2);
    }
}
